{include file="common/header"}
<link href="/static/admin/css/other.css" rel="stylesheet">
<main class="lyear-layout-content">
    <div class="container-fluid">
        <div class="row ant-menu-submenu">
            <div class="col-lg-10 col-b90">
                <div class="card right-card">
                    <div class="right-card-header card-header">
                        <h4>{:lang('plugin.Installed_plug-ins')}</h4>
                    </div>
                    <div class="card-toolbar clearfix">
                        <div class="example-box" id="choose-plugin-lists">
                            <button class="btn btn-default current" data-type="all">{:lang('public.all')}</button>
                            <button class="btn btn-default" data-type="yi">{:lang('plugin.Is_enabled')}</button>
                            <button class="btn btn-default" data-type="wei">{:lang('plugin.Is_not_enabled')}</button>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>{:lang('plugin.unique_identifier')}</th>
                                        <th>{:lang('public.name')}</th>
                                        <th>{:lang('public.introduce')}</th>
                                        <th>{:lang('public.author')}</th>
                                        <th>{:lang('public.version')}</th>
                                        <th>{:lang('public.state')}</th>
                                        <th>{:lang('public.operation')}</th>
                                    </tr>
                                </thead>
                                <tbody id="plugin">
                                {foreach :get_addons_list() as $key=>$item}
                                    <tr id="addons-{$item['state']}" class="addonsTr">
                                        <td>{$item['name']}</td>
                                        <td>{$item['title']}</td>
                                        <td>{$item['intro']}</td>
                                        <td>{$item['author']}</td>
                                        <td>{$item['version']}</td>
                                        <td>
                                            <label class="lyear-switch switch-success switch-light" id="plugin-state">
                                                <input{:checked($item['state'], 1)} type="checkbox" id="plugin-name-{$item['name']}" data-name="{$item['name']}">
                                                <span></span>
                                            </label>
                                        </td>
                                        <td>
                                            <div class="btn-group">
                                                {if is_plugin_config($item['name'])}
                                                    <a class="btn btn-xs btn-default set-default" data-url="{:adminUrl('admin/Plugins/plugin_config',['name'=>$item['name']])}">{:lang('public.config')}</a>
                                                {/if}
                                                <a class="btn btn-xs btn-default" href="/addons/{$item['name']}" target="_blank" >{:lang('public.debugging')}</a>
                                                 <a class="btn btn-xs btn-default detele" data-name="{$item['name']}">{:lang('public.delete')}</a>
                                                 
                                                 <a class="btn btn-xs btn-default" href="{$item['website'] ?? ''}" target="_blank" >{:lang('public.website')}</a>
                                            </div>
                                        </td>
                                    </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
{include file="common/footer"}
<script>
    let IM_config = {
        pluginState: "{:adminUrl('admin/Plugins/plugin_state')}",
        pluginUninstall: "{:adminUrl('admin/Plugins/plugin_uninstall')}"
    };
</script>
<script type="text/javascript" src="/static/admin/js/addons.js"></script>
<script type="text/javascript" src="/static/admin/js/plugin.js"></script>
